Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update INotifyCollectionChanged events in MenuItems and FooterMenuItems of the NavigationView #1098

Merged
merged 6 commits into from
Jun 11, 2024

Conversation

ioswald
Copy link
Contributor

@ioswald ioswald commented May 23, 2024

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

If you modify a databound observable collection to navigationview menu/footer items and then modify that list later in the program, the ui will not update with the new items.

Issue Number: N/A

What is the new behavior?

Ui now updates when binding source is updated.

  • added source binding list change event handling for navigationview menu/footer items.
  • Added collection action handling of menu/footer items.

Other information

…onview menu/footer items.

- Fixed menu/footer items not updating with databinding source if items modified post init.
@ioswald ioswald requested a review from pomianowski as a code owner May 23, 2024 17:49
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request navigation Changes to navigation related controls. dotnet release labels May 23, 2024
@ioswald ioswald marked this pull request as draft May 23, 2024 18:18
@ioswald ioswald closed this May 23, 2024
@ioswald ioswald reopened this May 23, 2024
@ioswald
Copy link
Contributor Author

ioswald commented May 23, 2024

Fixed stackoverflow due to recursive call from collection change event when updating from binding source.

@ioswald ioswald marked this pull request as ready for review May 23, 2024 19:03
@crippledfaith
Copy link

Hi please look at (#1092) You don't need to add the items to another collection as it is an observable collection, any change to the collection will change the items.

@ioswald
Copy link
Contributor Author

ioswald commented Jun 8, 2024

The initial items get added to the observable collection and update when you set the itemssource, but you aren't adding a binding to the itemssource; they're just being added from one to the other; so if the itemssource changes after the initial binding is done; the items do not update.

@pomianowski pomianowski changed the base branch from main to development June 10, 2024 13:20
@pomianowski pomianowski self-assigned this Jun 10, 2024
@pomianowski pomianowski changed the title Navigation view.menuitem fix Update INotifyCollectionChanged events in MenuItems and FooterMenuItems of the NavigationView Jun 10, 2024
@pomianowski pomianowski merged commit 7db4af2 into lepoco:development Jun 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controls Changes to the appearance or logic of custom controls. dotnet navigation Changes to navigation related controls. PR Pull request release styles Topic is related to styles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants